<template >
<van-nav-bar
  title="搜索关注"
  left-text="返回"
  left-arrow
  @click-left="$router.go(-1)"
/>
<div style="margin: 10px;">
    </div>
<van-form >
  <van-cell-group inset>
    <div style="margin: 10px;">
    </div>
    <van-row gutter="20" >
      <van-col >  <van-checkbox v-model="model.gzsou" shape="square">关注</van-checkbox></van-col>
        <van-col > <van-checkbox v-model="model.sxsou"  shape="square">私信</van-checkbox></van-col>
          <van-col >  <van-checkbox  v-model="model.dzsou" shape="square">点赞</van-checkbox></van-col>
            <van-col > <van-checkbox v-model="model.mansou" shape="square">男</van-checkbox></van-col>
              <van-col > <van-checkbox v-model="model.femansou" shape="square">女</van-checkbox></van-col>
    </van-row>
    <van-row >
  <van-col span="7">    <van-field
    label-width="40px"
    v-model='model.gznumsou'
          label='操作'
          name='pattern'
         
          type='digit'
          required
          :rules='[{ required: true, message: "请输入正确内容" }]'
    /></van-col>
    <van-col span="10">    <van-field

          label='个人，间隔'
          v-model='model.waittimesou'
        
    /></van-col>
    <van-col span="6">    <van-field

label='秒'


/></van-col>
</van-row>



  <van-row >
  <van-col span="20">    <van-field
    v-model='model.commentsou'
          label='私信内容'
          name='pattern'
          placeholder='请输入内容'
          autosize
          type="textarea"
          required
          :rules='[{ required: true, message: "请输入正确内容" }]'
    /></van-col>


</van-row>
<van-row >
  <van-col span="20">    <van-field
    v-model='model.keywordsou'
          label='搜索关键词或短视频号'
          name='pattern'
          placeholder='请输入内容'
          autosize
          type="textarea"
          required
          :rules='[{ required: true, message: "请输入正确内容" }]'
    /></van-col>


</van-row>

  </van-cell-group>


  <div style="margin: 16px;">
    <van-button round block type="primary"   @click='startNow'>
      启动
    </van-button>
    <div style="margin: 10px;">
    </div>
    <van-button round block type="danger"   @click='stop'>
      停止
    </van-button>
  </div>
</van-form>
  



<!-- .page-full.VUE_DOUYIN
  van-nav-bar(
    title='DY看视频评赞1111111111111',
    left-text='返回',
    left-arrow,
    @click-left='$router.go(-1)'
  )
 
  .content.mt10
  
    van-form
      van-cell-group(inset)
        van-field(
          v-model='model.interval',
          label='观看时长',
          name='pattern',
          placeholder='请输入内容',
          type='digit',
          required,
          :rules='[{ required: true, message: "请输入正确内容" }]'
        ) 
     
        van-field(label='点赞概率')
          template(#input)
            van-slider(v-model="model.zanMax" :step="0.01" :max="1" :min="0")
              template(#button)
                .custom-button {{(model.zanMax *100).toFixed(0)}} %

        van-field(label='关注概率')
          template(#input)
            van-slider(v-model="model.subscribeMax" :step="0.01" :max="1" :min="0")
              template(#button)
                .custom-button {{(model.subscribeMax *100).toFixed(0)}} %

        van-field(label='评论概率')
          template(#input)
            van-slider(v-model="model.commentMax" :step="0.01" :max="1" :min="0")
              template(#button)
                .custom-button {{(model.commentMax *100).toFixed(0)}} %

        van-field(
          v-model='model.comment',
          label='评论内容',
          name='model.comment',
          placeholder='请输入内容',
          required,
          type='textarea',
          rows='2',
          autosize,
          :rules='[{ required: true, message: "请输入正确内容" }]'
        )

        van-field(
          v-model='model.max',
          label='观看量',
          name='pattern',
          placeholder='请输入内容',
          type='digit',
          required,
          :rules='[{ required: true, message: "请输入正确内容" }]'
        )
      div(style='margin: 16px')
        van-button(round, block, type='primary', @click='startNow') 启动
        van-button.mt10(round, block, type='danger', @click='stop') 停止
        .mt10.c6.fz14
          | 请先打开视频页:
          | 同城视频, 达人视频, 话题视频, 搜索结果视频... -->
</template>
<style>



  .cell{
    display: flex;
  }
</style>
<script>
import { ref } from 'vue';
export default {

  data () {
    return {
    
      model: {
        waittimesou:60,
        gznumsou:3,
        mansou:false,
         femansou:false,
         gzsou:false,
         dzsou:false,
         sxsou:false,
         keywordsou: '帅哥\n宠物\美食\n电影',
         commentsou: '不错哟\n点赞\n视频拍得非常好\nBGM恰到好处',
        ...JSON.parse(localStorage.VUE_DOUYIN || '{}'),
      },
    }
  },
  mounted () { },
  unmounted () {
    console.log('保存页面上的数据')
    localStorage.VUE_DOUYIN = JSON.stringify(this.model)
  },
  methods: {
    startNow () {
      localStorage.VUE_DOUYIN = JSON.stringify(this.model)
      auto.invoke(
        'runRobotNow',
        [{ robot: require('@/auto/robot/robot.sousuo'), ...this.model }],
        () => {
          // log('ajFun1 回调:', typeof r, r)
        },
      )
    },
    stop () {
      auto.invoke('robotStop', [], () => { })
    },
  },
}
</script>
<style lang='stylus' scoped></style>
